//
//  ECIPSettingTableViewCell.m
//  ECERP.CRM
//
//  Created by Mac on 2018/10/19.
//  Copyright © 2018年 Mac. All rights reserved.
//

#import "ECIPSettingTableViewCell.h"

@interface ECIPSettingTableViewCell()


@property (nonatomic,strong) UISwitch *switchV;
@property (nonatomic,strong) CAShapeLayer *lineLayer;

@end

@implementation ECIPSettingTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
       self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        
        [self.contentView addSubview:self.nameLab];
        [self.contentView addSubview:self.addressLab];
        [self.contentView addSubview:self.switchV];
        [self.contentView.layer addSublayer:self.lineLayer];
        
    }
    return self;
}


- (UILabel *)nameLab
{
    if (!_nameLab) {
        _nameLab=[[UILabel alloc]initWithFrame:CGRectMake(12, 16, 120, 14)];
        _nameLab.textColor = ECCOLOR_NAVIBACK;
        _nameLab.text = @"内侧1";
        _nameLab.font = ECFONT(14);
    }
    return _nameLab;
}


- (UILabel *)addressLab
{
    if (!_addressLab) {
        _addressLab = [[UILabel alloc]initWithFrame:CGRectMake(_nameLab.left, _nameLab.bottom+12, 200, 14)];
        _addressLab.font=ECFONT(14);
        _addressLab.textColor=ECCOLOR_FONT_EXPLAIN;
        _addressLab.text=@"sxapitest.01loveinway.com";
    }
    return _addressLab;
}

- (UISwitch *)switchV
{
    if (!_switchV) {
        _switchV=[[UISwitch alloc]initWithFrame:CGRectMake(ECSCREEN_WIDTH-63, 22, 42, 26)];
        _switchV.on=YES;
    }
    return _switchV;
}

- (CAShapeLayer *)lineLayer
{
    if (!_lineLayer) {
        _lineLayer=[CAShapeLayer layer];
        _lineLayer.borderWidth = 0.5;
        _lineLayer.borderColor = ECCOLOR_TEXTBOTTOMLINE.CGColor;
        _lineLayer.frame=CGRectMake(12, 69, ECSCREEN_WIDTH-24, 0.5);
    }
    return _lineLayer;
}


@end
